/**
 * created by dqn 2018/3/11 9:43
 */

package main.controller.pages;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;

@Controller
public class SearchPageController {
    @RequestMapping(value = "/search/page", method = RequestMethod.GET)
    public String getSearchPage(HttpSession httpSession,String key) {
        try {
            key = new String(key.getBytes("iso-8859-1"),"utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        httpSession.setAttribute("searchKey",key);
        return "search";
    }
}
